import React from 'react';
import ReactDOM from 'react-dom/client';

import Login from "./pages/Loign/Login";
import Layouts from "./pages/Layout/layout";

import Home from "./pages/Home/home";
import Access from "./pages/Access/accessClass";
import Audit from "./pages/Audit/audit";
import Profile from "./pages/Profile/profile";

import reportWebVitals from './reportWebVitals';
// https://reactrouter.com/   React Router  v6 

import {
  BrowserRouter, Routes,
  Route,
} from "react-router-dom";


// ant design ui组件库
import './index.css';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <BrowserRouter>
      <Routes>
       
        <Route path="/layout" element={<Layouts />}>
          <Route path="home" element={<Home />}></Route>
          <Route path="access" element={<Access />}></Route>
          <Route path="audit" element={<Audit />}></Route>
          <Route path="profile" element={<Profile />}></Route>
        </Route>
        
        <Route path="/" element={<Login />}></Route>
        <Route
          path="*"
          element={
            <main style={{ padding: "1rem" }}>
              <p>404,There's nothing here!</p>
            </main>
          }
        />
      </Routes>
    </BrowserRouter>

  </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
